home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / C / Games / Abalone 1.4.2 / src / Settings.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-09-21  |  1.8 KB  |  93 lines  |  [TEXT/MPS ]

  1. #ifndef SETTINGS_H
  2. #define SETTINGS_H
  3.  
  4.  
  5. #include "Rules.h"
  6.  
  7. #ifndef THINK_C
  8. #include <QuickDraw.h>
  9. #include <Types.h>
  10. #endif
  11.  
  12.  
  13. enum _playerKind
  14. {
  15.     humanPlayer = 1,
  16.     networkPlayer,
  17.     macPlayer
  18. };
  19.  
  20. enum _strategy
  21. {
  22.     human = -1,
  23.     firstStrategy = 0,
  24.     secondStrategy,
  25.     thirdStrategy,
  26.     fourthStrategy
  27. };
  28.  
  29.  
  30. typedef struct
  31. {
  32.     #define     kSettingsVersion    140
  33.     short        Version;
  34.     short        Players;
  35.     short        FieldWidth;
  36.     short        FieldHeight;
  37.     Boolean        SoundOn;
  38.     Boolean        Balls3D;
  39.     short        BackgroundPictID;
  40.     Boolean        ShowNotation;
  41.     short        PlayerKind[kPlayers+1];
  42.     short        Strategy[kPlayers+1];
  43.     short        Level[kPlayers+1];
  44.     Boolean        Connected[kPlayers+1];
  45.     char         PlayerName[kPlayers+1][32];
  46.     RGBColor    Color[kPlayers+1];
  47.     
  48. }    Settings, *SettingsPtr;
  49.  
  50.  
  51. void        SetPlayerName (SettingsPtr settings, short player, StringPtr name);
  52. StringPtr    GetPlayerName (SettingsPtr settings, short player);
  53.  
  54. Boolean        ConfirmPlayerKind (short player, short type);
  55. Boolean        ConfirmNetQuit (void);
  56.  
  57. void        SetPlayerKind (SettingsPtr settings, short player, short type);
  58. //    Sets the player to a type.
  59. //    Can fail, because the user is asked to confirm
  60. //    the breaking of a network connection.
  61.  
  62. short        GetPlayerKind (SettingsPtr settings, short player);
  63. //    Returns the type of a player.
  64.  
  65. Boolean        IsNetPlayer (SettingsPtr settings, short player);
  66. Boolean        IsMacPlayer (SettingsPtr settings, short player);
  67. Boolean        IsHumanPlayer (SettingsPtr settings, short player);
  68.  
  69. short        CountNetPlayers (SettingsPtr settings);
  70. short        CountMacPlayers (SettingsPtr settings);
  71. short        CountHumanPlayers (SettingsPtr settings);
  72.  
  73.  
  74. #ifdef SETTINGS_C
  75.  
  76. #include "Connection.h"
  77. #include "StringLib.h"
  78.  
  79. #ifndef THINK_C
  80. #include <Dialogs.h>
  81. #include <Strings.h>
  82. #endif
  83.  
  84. short        CountPlayerKind (SettingsPtr settings, short type);
  85.  
  86. #else
  87.  
  88. extern Settings    gSet;
  89.  
  90. #endif
  91.  
  92.  
  93. #endif